package com.ctgu.service;

import com.ctgu.dao.ProductMapper;
import com.ctgu.entity.Product;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProductServiceImpl implements ProductService {
    @Autowired
    private ProductMapper productMapper;

    @Override
    public List<Product> findBySort1(int sort1) {
        return productMapper.findBySort1(sort1);
    }

    @Override
    public List<Product> findByName(String name) { return productMapper.findByName(name); }

    @Override
    public Integer countShopping(int id) { return productMapper.countShopping(id); }

    @Override
    public List<Product> sortByPrice(int sort1) { return productMapper.sortByPrice(sort1); }

    @Override
    public List<Product> sortByPopularity(int sort1) { return productMapper.sortByPopularity(sort1); }
}
